// 引入菜单列表接口
import { menuList } from "../../../request/api"
const state = {
    menulist:[]
}

const getters = {
    getMenuList(state){
        return state.menulist
    }
}

const mutations = {
    GET_MENULIST(state,payload){
        state.menulist = payload
    }
}

const actions = {
    // 调用菜单列表接口
    async changeMenuListAction({commit}){
        let res = await menuList({
            istree:1
        })
        console.log(res,'菜单列表');
        commit('GET_MENULIST',res.list)
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    // 命名空间
    namespaced:true
}